﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog x-modal-dialog" style="width:650px; margin-top: 150px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb no-bottom-border clearfix">

      <h2><i class="glyphicon glyphicon-fire" title="添加模块"></i>&nbsp;&nbsp;<span>添加模块</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" id="submit" method="POST" action="${ctx.host}/modules" data-validate="true">

      <div class="modal-body">
        
        <div class="form-group x-form-group">
          
          <label class="control-label col-xs-4">模块名称：</label>
          <div class="pull-left col-xs-6">
            <input type="text" name="name" class="form-control" placeholder="使用中文" data-validate="required">
          </div>
          
        </div>
        
        <div class="form-group x-form-group">
          
          <label class="control-label col-xs-4">模块别名：</label>
          <div class="pull-left col-xs-6">
            <input type="text" name="alias" class="form-control" placeholder="使用英文" data-validate="required">
          </div>
          
        </div>
        
      </div>

      <div class="modal-footer clearfix">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
    </form>

  </div>

</div>
  <script type="text/javascript">
  $(function(){
      var that = this,
      $nameSelect = $("select[name='name']"),
      $aliasSelect = $("select[name='alias']");
  
      $nameSelect.select2({
        placeholder: "模块名称",
        minimumResultsForSearch : 5,
        allowClear : false,
        width: '100%'
      });
  
      $aliasSelect.select2({
          placeholder: "模块别名",
          minimumResultsForSearch : 5,
          allowClear : false,
          width: '100%'
        });
      
  });
  </script> 
